﻿using System;
using System.IO;
using System.Collections;

namespace Bingo
{
	class MainClass
	{
		public static void Main (string[] args)
		{
			Hashtable personInfo = setInputValue ();
			Actions actionObj;
			switch (Convert.ToInt32 (personInfo["sex"])) {
			case 0: 
				actionObj = new Girl (personInfo);
				break;
			case 1:
				actionObj = new Boy (personInfo);
				break;
			default :
				actionObj = new Boy (personInfo);
				break;
			}
			string words = actionObj.say ();
			Console.WriteLine (words);
			Console.ReadKey ();
		}

		protected static Hashtable setInputValue ()
		{
			string name;
			string country;
			int sex; 
			string skirtColor;
			int age;

			Hashtable info = new Hashtable ();
			TextReader tIn = Console.In;
			Console.WriteLine ("please input your name.");
			name = tIn.ReadLine ();
			Console.WriteLine ("please input your country.");
			country = tIn.ReadLine ();
			Console.WriteLine ("please input your sex, '1' is boy, '0' is girl.");
			sex = Convert.ToInt32 (tIn.ReadLine ());
			if (sex == 0) {
				Console.WriteLine ("Please tell me the color of skirt is your favourite.");
				skirtColor = tIn.ReadLine ();
			}
			Console.WriteLine ("Please input your age.");
			age = Convert.ToInt32 (tIn.ReadLine ());
			info.Add ("name", name);
			info.Add ("age", age);
			info.Add ("sex", sex);
			info.Add ("country", country);
			return info;
		}
	}
}
